<?php
include "include.php";
switch($_POST['home_active']){
	case "add_program_name":
	$add_progam_name_res=$dbconnect->query("insert into program_name (program_name, program_info, add_date) values ('".$_POST['program_name']."', '".$_POST['program_info']."', NOW())");
	is_error($add_program_name_res);
	$back_home = "location: home.php";
	header($back_home);
}
switch($_POST['profile_active']){
	case "add_cmd_key":	
	if($_POST['cmd_dis_type_arg'] == null){
	$cmd_dis_type_arg_res=$dbconnect->getRow("select key_type_arg_def from cmd_key_type_def where key_type_name = '".$_POST['cmd_dis_type']."'",array(),DB_FETCHMODE_ASSOC);
	is_error($cmd_dis_type_arg_res);
	$cmd_dis_type_arg=$cmd_dis_type_arg_res['key_type_arg_def'];
	}else{
	$cmd_dis_type_arg=$_POST['cmd_dis_type_arg'];
	}
	/*
	$cmd_nm
	$cmd_dis_key
	$cmd_dis_type
	$cmd_dis_type_arg
	$cmd_dis_value_def
	$cmd_write_file_method
	$cmd_notices	
	*/
	$cmd_nm=$_POST['cmd_nm'];
	$cmd_dis_key=$_POST['cmd_dis_key'];
	$cmd_dis_type=$_POST['cmd_dis_type'];
	$cmd_dis_value_def=$_POST['cmd_dis_value_def'];
	$cmd_write_file_method=$_POST['cmd_write_file_method'];
	$cmd_notices=$_POST['cmd_notices'];
	$add_cmd_sql="insert into ".$_REQUEST['tabname']." values ('".$cmd_nm."', '".$cmd_dis_key."', '".$cmd_dis_type."','".$cmd_dis_type_arg."', '".$cmd_dis_value_def."', '".$cmd_write_file_method."', '".$cmd_notices."')";
	$add_cmd_res=$dbconnect->query($add_cmd_sql);
	is_error($add_cmd_res);
	$back_home="location: profile.php?profile_active=1&tabname=".$_REQUEST['tabname'];
	header($back_home);	
}
?>
